<form name="appForm" method="post" action="" id="appForm">
<?php echo $this->render('/category-solution/include/toolbar.php');?>
<?php echo $this->render('/category-solution/include/submenu.php');?>

 <!-- BEGIN: CONTENT -->
 <div id="element-box">
   <div class="t">
     <div class="t">
        <div class="t"></div>
   </div>
     </div>
<div class="m">
   <!-- BEGIN: ELEMENT BOX -->
       <!-- Area 4: In du lieu lay tu database -->
     <div id="subicon_left">
       <?php echo $this->searchButton($this->keyword); ?>
       
     
     </div>
     
     <div id="subicon_right">
        <?php 
        	    echo $this->stateButton($name='secnews',$default='Select Section',$this->result);
        	   
             	$a['1']="Published";
                $a['0']="Unpublished";
                echo $this->stateButton($name='status',$default='Select State',$a);
        ?>
       
        
     </div>  
           <table class="adminlist" width="100%">
               <thead>
                   <tr>
                     <th width="50" ><input type="checkbox" name="checkall" id="checkall" onclick="checkedAll();"></th>
                     <th width="250">Title</th>
                  	 <th width="150">Images</th>
                  	 <th width="50">Feature</th>
                     <th width="50">Published</th>
                     <th width="80">Order</th>	
                     <th width="100">Language</th>	
                     <th width="200">Section</th>	
                     <th width="80">Control</th>						
                     <th width="60">ID</th>
                   </tr>
               </thead>
               <?php 
           
				  if(count($this->paginator)>0){
				    	$i=0;
					  foreach ($this->paginator as $key => $val){
						$id 		    = $val['id'];
						$title 		    = $val['title'];
						$section        = $val['theloai'];
						$language       = $val['ngonngu'];
						
						$images		    = $val['images'];
						if($images==null) $images ="/public/templates/admin/system/images/noimage.jpg";
							
									
						$status     	= $val['published'];	 						
						$attribs = array('icon'=>'inactive.png',
										 'iconDir' => "images/icon/");
		
						if($val['published']== 1)
						{		
							$attribs['icon'] = 'active.png';
						}
						$lnkStatus  = $this->url(array('action'=>'status','id'=> $id,'s'=>$val['published']));
						$status 	= $this->cmsIcon('status',$lnkStatus,$attribs);
						
						
						$attribs = array('icon'=>'disabled.png',
										 'iconDir' => "images/icon/");
						
						if ($val['featured']==1)
						{
							$attribs['icon'] = 'featured.png';
						}						
						
						$lnkStatus  = $this->url(array('action'=>'featured','id'=> $id,'s'=>$val['featured']));
						$featured 	= $this->cmsIcon('featured',$lnkStatus,$attribs);				
						
						
						
						$ordering 		= $this->formText('order[' . $val['id'] . ']',$val['order'],array('style'=>'width: 30px; text-align: center;'));

						$lnkSate  = $this->url(array('action'=>'state','id'=> $val['id']));
						$iconSate = $this->IconButton('Edit item',$lnkSate,array('icon'=>'edit.png'));
																						
						$lnkEdit  = $this->url(array('action'=>'edit','id'=> $val['id']));
						$iconEdit = $this->IconButton('Edit item',$lnkEdit,array('icon'=>'edit.png'));
												
						$lnkDel  = $this->url(array('action'=>'delete','id'=> $val['id']));
						$iconDel = $this->IconButton('Delete item',$lnkDel,array('icon'=>'action_delete.gif'));
												
						$strIcon = $iconEdit . ' ' . $iconDel;
						$cid = $this->formCheckbox('cid[]',$val['id'],array('class'=>'check'));
				
					?>

               <tr class="<?php  if($i%2==0) echo chan ; else echo le;?> hori">						
                         <td align="center"><?php echo $cid;?></td>
                         <td align="left"><a href="<?php echo JURI; ?>/manager/category-solution/edit/id/<?php echo $id;?>"><?php  echo $title;?></a> </td>
                         <td align="center"><img  width="150" height="100" src="<?php  echo JURI.$images;?>"/> </td>
                         <td align="center"><?php echo $featured; ?></td>
                         <td align="center"><?php  echo $status;?> </td>
                         <td align="center"><?php  echo $ordering;?></td>
                         <td align="center"><?php  echo $language;?></td>
                         <td align="center"><?php  echo $section;?></td>
                         <td align="center"><?php echo $strIcon;?></td>   
                         <td align="center"><?php  echo $id;?></td>          
                         
               </tr>         
                    <?php 
                       $i++;
						}
					}
                	?>            
                                    <!-- BEGIN: PAGINATION (FOOT) -->
                                    <tfoot>
                                        <tr>
                                            <td colspan="10">
                                                <div class="container">
                                                    <div class="pagination">
                                                           <?php echo  $this->paginationControl($this->paginator, 'Sliding', 'paging.phtml'); ?>	      
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>					
                                    </tfoot>				<!-- END: PAGINATION (FOOT) -->
                                </table>
                                <!-- Area 4: In du lieu lay tu database - End -->

                                <!-- END: ELEMENT BOX -->	
                              <div class="clr"></div>
                            </div>
                            <div class="b">
                                <div class="b">
                                    <div class="b"></div>
                                </div>
                            </div>
                        </div>
                        <!-- END: 	CONTENT -->

</form>